/**
 * Created by WangMing on 15/12/9.
 */
define(["../../../service"
], function(api) {
    // 定义所有相关的vmodelplayerlivewidgetplayerlivewidget
    var vm = avalon.define({
        $id: "notice",
      
        $breadcrumb: {
            stateName: "notices.item",
            guid:"",
            title:""

        },
        notice:{},
        $skipArry: ["playerWidget","notice"],
    
    });

    return avalon.controller(function($ctrl) {
        // 视图渲染后，意思是avalon.scan完成
        $ctrl.$onRendered = function() {
          
        };
        // 进入视图
        $ctrl.$onEnter = function(param, rs, rj) {
            vm.itemID = param.itemID;
            return api.getItems({
                method:api.getNotice,
                query:{
                    id : vm.itemID
                }
            },function(res){
                vm.notice = {}
                vm.notice = res.data;
                vm.$breadcrumb.title = vm.notice.title
            })
        };
        // 对应的视图销毁前
        $ctrl.$onBeforeUnload = function() {
         
        };
        $ctrl.$vmodels = [vm];
    })
});
